1".$strContent; //echo "
";print_r($GLOBALS['template']);echo "
"; if (is_array($GLOBALS['template']) && count ($GLOBALS['template']) > 0) { foreach ($GLOBALS['template'] as $strKey => $strVal) { if ($strKey == "CONTENT") $strContentValue = $strVal; else { $arrFrom[] = "{\$".$strKey."}";//strtoupper $arrTo [] = $strVal; } } $arrFrom[] = "{\$CONTENT}"; $arrTo [] = $strContentValue; //echo $strContentValue; $strContent = str_replace ($arrFrom, $arrTo, $strContent); $strContent = str_replace ($arrFrom, $arrTo, $strContent); if ($GLOBALS['replace']) { $strContent = str_replace ($GLOBALS['replace']['from'], $GLOBALS['replace']['to'], $strContent); } } //print_r($arrFrom); //echo "
2.". $strContent; return $strContent; } function getSiteContent ($strID, $strSiteID) { $arrResult = array(); //$strContent .= "site_content $strID, $strSiteID".print_r($arrPage, true); $arrResult = queryGetMenuPage ($strID, $strSiteID); /* * $strContent = ""; $arrResult["header"] .= $arrResult["title"]; //echo "*****".$_REQUEST["id"]; //print_r($arrPage); $strContent .= $arrResult["src"]; if ($arrPage["lastupdate"]) $strContent .= "

Last update: ".$arrPage["lastupdate"]; //print_r($arrResult);die(); $arrResult["content"] = $strContent; */ return $arrResult; } function getSiteModule ($cmsmodule, $site_id, $strModuleArg=null, $placement=null) { $content = null; //echo "getSiteModule:*".$cmsmodule; if ($cmsmodule) { $GLOBALS["module"] = $cmsmodule; //$arrMenu["cmsmodule"]; //$strModulePath = "modules/".$GLOBALS['config']['client']."/".$GLOBALS["module"]; //if (!is_dir($strModulePath)) $strModulePath = "modules/".$GLOBALS["module"]; require_once ($strModulePath ."/".$GLOBALS["module"] .".php"); if (function_exists('getModuleContent'.$cmsmodule)) { $content = call_user_func('getModuleContent'.$cmsmodule, $site_id, $strModuleArg, $placement); //$content = getModuleContentSnippet($site_id, $strModuleArg); } else { $content = getModuleContent($site_id, $strModuleArg, $placement); //echo "getSiteModule:$strContent"; } //call_user_func_array('increment', array(&$a)); // You can use this instead before PHP 5.3 //echo $a."\n"; /*switch ($cmsmodule) { case "snippet": $content = getModuleContentSnippet($site_id, $strModuleArg); break; case "sitemap": $content = getModuleContentSitemap($site_id, $strModuleArg); break; case "events": $content = getModuleContentEvents($site_id, $strModuleArg); break; case "blikopeners": $content = getModuleContentBlikopeners($site_id, $strModuleArg); break; default: $content = getModuleContent($site_id, $strModuleArg); //echo "getSiteModule:$strContent"; break; }*/ } return $content; /* either a string or an array */ } function queryGetSelectedMenus($strID) { //echo "queryGetSelectedMenus".$strID."
"; $query = "SELECT id, parent_id, root_id, css FROM ".$GLOBALS['tables']['menus']. " m WHERE id=".$strID; $result = mysql_query($query); if ($result && mysql_num_rows($result)==1){ $arr = mysql_fetch_assoc($result); $arrResult[] = $arr; if ( $arr["root_id"]!=0 ) { $arrResult = array_merge(queryGetSelectedMenus($arr['parent_id']) ,$arrResult); } } return $arrResult; } /* * Return the deepest css stylesheet that can be found in the list of menus */ function getStyleSheet ($arrMenuPath) { //echo "

";print_r($arrMenuPath);echo "
"; $strResult = ''; for($i=count($arrMenuPath)-1; $i >=0; $i--) { $arr = $arrMenuPath[$i]; //echo "*". $arr['css']."
"; if ($arr['css']) { $strResult = $arr['css']; break; } } return $strResult; } function getMainMenuSub ($array, $id){ foreach ($array as $strID=>$arr) { if($arr['id'] == $id){ return $arr['children']; } } return false; } ?> getArticleID()) $_REQUEST['id'] = $temp->getArticleID(); if ($GLOBALS['config']['startpage']) $strHomePage = $GLOBALS['config']['startpage']; else $strHomePage = $GLOBALS['config']['prefixmenu'].'home'; // this should be the default name for every (sub)site if (false && memberPropertySet('allowed_module_ids')) { //echo "step1"; $GLOBALS['config.allowed_module_ids'] = memberProperty('allowed_module_ids'); } else { //echo "step2"; // Create a list of all module_id's which are allowed for anonymous users. We do this only once. $membergroups = memberGroupGetIds(memberId()); $membergroups[] = 0; $strMemberGroupIds = implode(',', $membergroups); $sql = "SELECT module_id FROM {$GLOBALS['tables']['menuxmembergroup']} WHERE membergroup_id IN ({$strMemberGroupIds})"; $arrModules = pdoQueryBuildArray($sql, null, null, 'module_id'); if(!is_array($GLOBALS['config.allowed_module_ids'])) $GLOBALS['config.allowed_module_ids'] = $arrModules; } if ($GLOBALS['debuginfo']) { echo $_REQUEST["page"] .",". !$_REQUEST["id"] .",". !$_REQUEST["mod"]; } // have a default page for sure if (!$_REQUEST['page'] && !$_REQUEST['id'] && !$_REQUEST['mod']) $_REQUEST["page"] = $strHomePage; if ($_REQUEST['id'] && is_numeric($_REQUEST['id'])) { $arrMenu = queryModuleById($_REQUEST['id'], $GLOBALS['config']['SiteID']); } elseif ($_REQUEST['page']) { $arrMenu = queryModuleByName($_REQUEST['page'], $GLOBALS['config']['SiteID']); $_REQUEST['id'] = $arrMenu['id']; } elseif ($_REQUEST['mod']) // find the page { $strQuery = "SELECT module FROM {$GLOBALS['tables']['menus']} m, {$GLOBALS['tables']['module']} module WHERE m.module_id = module.id AND module.site_id = :siteid AND module.name = :modulename"; $arrValues[':siteid'] = $GLOBALS['config']['SiteID']; $arrValues[':modulename'] = 'congresssection'; $arrModules = pdoQuery($strQuery. $arrValues); if(count($arrModules) > 0) $strSessionPage = $arrModules[0]['module']; $_REQUEST['page'] = $strSessionPage; $arrMenu = queryModuleByName($_REQUEST['page'], $GLOBALS['config']['SiteID']); $_REQUEST['id'] = $arrMenu['id']; } if (is_array($arrMenu) && count($arrMenu)==0) { //header("HTTP/1.0 404 Not Found"); //die("site_not_found"); header("HTTP/1.0 404 Not Found"); $arrMenu = queryModuleByName('404', $GLOBALS['config']['SiteID']); $_REQUEST['id'] = $arrMenu['id']; $temp = '111'; } if ($GLOBALS['debuginfo']) { echo "
queryModuleById
";print_r($arrMenu);echo "
"; } // fill page with a readable name $_REQUEST["page"] = $arrMenu["module"]; // try to obtain page content FROM THE PAGE TABLE $arrContent = $GLOBALS['content']->getSiteContent($_REQUEST['id']); //$arrContent = getSiteContent($_REQUEST["id"], $GLOBALS['config']['SiteID']); $strMenuIDClicked = 0+$arrContent['id']; if ($GLOBALS['debuginfo']) { echo "
";print_r($arrContent);echo"
"; } // ask for the content including any module info, or if theres no content at this level go automatically one deeper // and possibly overwrite the chosen arrContent $arrContent = getMenuContent($arrContent, true); // yes go one level deeper if necessary if ($GLOBALS['debuginfo']) { echo "AFTER
";print_r($arrContent);echo"
"; } //$GLOBALS["template"]['CONTENT'] = $arrContent['content']; $_REQUEST["id"] = 0+$arrContent['id']; // the real id we are going to work with from now //Add page view to current page //setPageView($_REQUEST['id']); //echo "
";print_r($arrContent);echo"
"; // now we know where we work with $arrTemplate = array_change_key_case($arrContent,CASE_UPPER); //print_r($arrTemplate); $arrTemp = $GLOBALS['template']; if (!is_array($GLOBALS['template'])) $GLOBALS['template'] = array(); $GLOBALS['template'] = array_merge($arrTemplate, $GLOBALS['template']); $GLOBALS['template']['EXTRAHEADER'] = $arrTemp['EXTRAHEADER']; $arrTemplateFields = array ('BREADCRUM', 'CONTENT', 'CSS', 'HEADERTITLE', 'META_SUBJECT', 'META_DESCRIPTION', 'SCRIPT', 'STYLESHEET' ,'TITLE'); // initialize all the fields fr the template to empty foreach ($arrTemplateFields as $strKey) { //$upperKey = strtoupper($strKey); //$GLOBALS['template'][$strKey]=$arrTemplate[$strKey]; if (!$GLOBALS['template'][$strKey]) $GLOBALS['template'][$strKey] = ''; } $GLOBALS['template']['HEADERTITLE'] = $arrContent['menu']; // get the path to the menu $arrPathTree = getFullMenuPath(array(),$_REQUEST['id']); // returns a tree structure with children //print_r($arrPathTree); $arrSelectedMenus = getMenuArray($arrPathTree); // returns a flat list of menu items. thus id=>$arrMenu //print_r($arrSelectedMenus ); $arrSelectedIds = getSelectedIdsFromPathTree($arrPathTree); // returns the ids of those items like array(363,234,21) all the ids of the menu path //print_r($arrSelectedIds ); //print_r(getStyleSheets($arrPathTree)); //print_r($arrPathTree); // Check member authorization for the requested menu. Redirect to login screen if required. checkMenuAuthorization($arrPathTree); //$GLOBALS['template']['CSS'] = getStyleSheet($arrSelectedMenus); // move from the select page up to see if you can find a different stylesheet $GLOBALS['template']['CSS'] = getCssStyleSheet($arrPathTree); $GLOBALS['template']['SCRIPT'] = getJavascriptsInPath($arrPathTree); //echo $GLOBALS['template']['CSS']; //echo "*".$GLOBALS['template']['SCRIPT']; //echo "
arrSelectedIds:";print_r($arrSelectedIds);echo"
"; if ($GLOBALS['debuginfo']) {echo "
getFullMenuPath
";print_r($arrPathTree);echo "
";} // and make it a breadcrum $GLOBALS["template"]['BREADCRUM'] = getBreadCrum($arrPathTree, false, false); if ($GLOBALS['template']['BREADCRUM']) $GLOBALS['template']['BREADCRUM'] = '
'.$GLOBALS['template']['BREADCRUM']."
"; if($arrSelectedIds[0] != '') { $mainMenuId = $arrSelectedIds[0]; } else { $mainMenuId = mmysql_real_escape_string_string($_REQUEST["id"]); } // calculate the top level menus, 2 levels deep $arrFirstMainMenuTree = getMenuTree($GLOBALS['config.website.rootid'], 8, 'MAIN-UPP', $arrSelectedIds,NULL,-1,!$GLOBALS['config']['menus.all'],0,$GLOBALS['config.allowed_module_ids']); $arrFirstMainTreeIds = getMenuTreeKeys($arrFirstMainMenuTree); $arrSecondMainMenuTree = getMenuTree($GLOBALS['config.website.rootid'], 8, 'MAIN-LOW', $arrSelectedIds,NULL,-1,!$GLOBALS['config']['menus.all'],0,$GLOBALS['config.allowed_module_ids']); $arrSecondMainMenuIds = getMenuTreeKeys($arrSecondMainMenuTree); $arrSubMainMenuTree = getMainMenuSub($arrFirstMainMenuTree, $mainMenuId); // Merge main menu arrays for later use. $arrMainTreeIds = array_merge($arrFirstMainTreeIds,$arrSecondMainMenuIds); if($GLOBALS['config']['menu.depth'] == '') $GLOBALS['config']['menu.depth'] = 2; $GLOBALS['template']['MENUMAIN-UPPER'] = getSiteMainMenus($arrFirstMainMenuTree, $GLOBALS['config']['menu.depth'], 'MAIN',null,null,0,"menu",mmysql_real_escape_string_string($_REQUEST["id"])); // and apply in to generate the menu links $GLOBALS['template']['MENUMAIN-LOWER'] = getSiteMainMenus($arrSecondMainMenuTree, $GLOBALS['config']['menu.depth'], "MAIN-LOW",null,null,0,"menu",mmysql_real_escape_string_string($_REQUEST["id"])); // and apply in to generate the menu links $GLOBALS['template']['MENUFOOTER-LEFT'] = getSiteMenus(getMenuTree($GLOBALS['config.website.rootid'], 1, "FOOTER-L", $arrSelectedIds, NULL,-1,true,0,$GLOBALS['config.allowed_module_ids']),1, "footermenu",$GLOBALS['config']['menu.footer.left.divider']); $GLOBALS['template']['MENUFOOTER-RIGHT']= getSiteMenus(getMenuTree($GLOBALS['config.website.rootid'], 1, "FOOTER-R", $arrSelectedIds, NULL,-1,true,0,$GLOBALS['config.allowed_module_ids']),1, "footermenu",$GLOBALS['config']['menu.footer.right.divider']); $GLOBALS['template']['MENUTOP'] = getSiteMenus(getMenuTree($GLOBALS['config.website.rootid'], 1, "HEADER", $arrSelectedIds, NULL,-1,true,0,$GLOBALS['config.allowed_module_ids']),1, "header",$GLOBALS['config']['menu.topmenu.divider'],null,null,"topmenu"); $arrTree = getMenuTree($strMenuIDClicked, 5, NULL, $arrMainTreeIds, NULL,-1,true,0,$GLOBALS['config.allowed_module_ids']); $maxlevel= -1; $select=0; //print_r($arrSubMainMenuTree); if($arrSubMainMenuTree!=false) $GLOBALS['template']['SUBMAINMENUS'] = getSiteMainMenus($arrSubMainMenuTree, $maxlevel, "main",null,null,0,"menu",$mainMenuId, $select); // and apply in to generate the menu links else $GLOBALS['template']['SUBMAINMENUS'] = ''; // Determine content for submenu's //$GLOBALS['template']['SUBMENUS'] = getSiteMenus(getMenuTree($strMenuIDClicked, 1, NULL, $arrMainTreeIds, NULL, -1,true,0,$GLOBALS['config.allowed_module_ids']),1, "",""); //echo "
";print_r($arrFirstMainMenuTree);echo "
"; $GLOBALS['template']['SUBMENUS'] = getSiteMenus(getMenuTree($strMenuIDClicked, 1, NULL, $arrMainTreeIds, NULL, -1,true,0,$GLOBALS['config.allowed_module_ids']),5, "breadcrum","  "); if ($GLOBALS['template']['SUBMENUS'] != '') { $GLOBALS['template']['SUBMENUS'] = "
\"submenus:\"
{$GLOBALS['template']['SUBMENUS']}
"; } $GLOBALS["template"]["EXTRAHEADER"] .= ""; $GLOBALS['template']['SUBTITLE']= ''; $GLOBALS["template"]['SEARCHFORM'] = getSiteSearchForm(); // Right column $GLOBALS["template"]["LEFTCOLUMN"] = ""; $GLOBALS["template"]["RIGHTCOLUMN"] = ""; $GLOBALS['template']["PARENTID"] = $arrSelectedIds[0]; if (!$GLOBALS['template']['MENUMAIN-LOWER']) { $GLOBALS["template"]["EXTRAHEADER"] .= " #menublok2 { display: none; }\n \n"; } if ($arrContent['src_left']) { $strText = '
'; $strText .= $arrContent["src_left"]; $strText .= "
"; $GLOBALS["template"]["LEFTCOLUMN"] = $strText; $GLOBALS["template"]["EXTRAHEADER"] .= ' '; } if ($arrContent["src_right"]) { $strText = '
'; $strText .= $arrContent["src_right"]; $strText .= "
"; $GLOBALS["template"]["RIGHTCOLUMN"] = $strText; $GLOBALS["template"]["EXTRAHEADER"] .= ' '; } else { $GLOBALS["template"]["EXTRAHEADER"] .= ' ' ; } $GLOBALS["template"] = wrapContent($GLOBALS["template"]); $GLOBALS["template"]["KEYWORDS"] = $_REQUEST["keywords"]; $GLOBALS['template']['HOMEPAGE'] =''; // additional item // Banners $GLOBALS["template"]["BANNER_LEFT_BEFORE"] = getSiteModule ('banner', $GLOBALS['config']['SiteID'], null, 'LEFT_BEFORE'); $GLOBALS["template"]["BANNER_LEFT_AFTER"] = getSiteModule ('banner', $GLOBALS['config']['SiteID'], null, 'LEFT_AFTER'); $GLOBALS["template"]["BANNER_BEFORE"] = getSiteModule ('banner', $GLOBALS['config']['SiteID'], null, 'BEFORE'); $GLOBALS["template"]["BANNER_AFTER"] = getSiteModule ('banner', $GLOBALS['config']['SiteID'], null, 'AFTER'); $GLOBALS["template"]["BANNER_RIGHT_BEFORE"] = getSiteModule ('banner', $GLOBALS['config']['SiteID'], null, 'RIGHT_BEFORE'); $GLOBALS["template"]["BANNER_RIGHT_AFTER"] = getSiteModule ('banner', $GLOBALS['config']['SiteID'], null, 'RIGHT_AFTER'); $GLOBALS['thispage.url'] = $_SERVER['REQUEST_URI']; if (!strstr($GLOBALS['thispage.url'], "?")) $GLOBALS['thispage.url'] .= '?'; $GLOBALS['template']['SWITCH_HTML'] = (memberProperty("textonly")==1) ? "Full version" : "Text version"; $GLOBALS['template']['SWITCH_LOGIN'] = getSiteModule ('login_screen', $GLOBALS['config']['SiteID']); $GLOBALS['template']['ADMINPANEL'] = getAdminPanel(); $GLOBALS['template']['SEARCH_FORM'] = getSiteModule('search_form', $GLOBALS['config']['SiteID']); $GLOBALS["template"]["IDS"] = mmysql_real_escape_string_string($_REQUEST['ids']); $GLOBALS["template"]["PAGE"] = mmysql_real_escape_string_string($_REQUEST['page']); $GLOBALS["template"]["TEMPLATE_DIR"] = $GLOBALS['config']['template.dir']; $GLOBALS['template']["BASEDIR"] = $GLOBALS['config']['basedir']; if($GLOBALS['extraTitle']) $GLOBALS['template']['TITLE'] = $GLOBALS['template']['TITLE'] .' - '. $GLOBALS['extraTitle']; function getCssStyleSheet($arrPathTree_) { $arrCss = getStyleSheets ($arrPathTree_); $menuId = $GLOBALS['arrMenu']['id']; //echo "*".$menuId; if ($menuId) { $strQuery = "SELECT DISTINCT m.name, m.id FROM {$GLOBALS['tables']['module']} m, {$GLOBALS['tables']['menuxmodule']} mxm WHERE(mxm.menu_id = :menuid AND mxm.module_id = m.id) OR (mxm.menu_id=0 AND mxm.module_id =m.id) AND mxm.visible=1 ORDER BY nr"; $arrValues[':menuid'] = $menuId; $arrResults = pdoQuery($strQuery, $arrValues); foreach($arrResults as $i) { $arrModules[] = '/../library/sitedesq/www/modules/'.$i['name'].'/'.$i['name'].'.css'; $arrModules[] = '/css/modules/'.$i['name'].'.css'; } } //print)_ if($arrModules && count($arrModules)>0) $arrCss = array_merge($arrCss,$arrModules); //print_r($arrCss); //echo "*". end($arrCss); foreach($arrCss as $css){ if(strstr($css,'tpl/')) $url = $css; else $url = $GLOBALS['config']['template.dir'].$css; $str .= ' '."\n"; } return $str; } function getStyleSheets ($arrPathTree_) { $arrResult = array(); if ($arrPathTree_['css']) { $arrResult[] = $arrPathTree_['css']; //echo "
";print_r($arrPathTree_); echo "
"; //echo "arrResult[{$arrPathTree_['id']}] = {$arrPathTree_['css']};"; } if (isset($arrPathTree_['selected_child'])) { //echo "
nextlevel"; $arrResult = array_merge($arrResult, getStyleSheets($arrPathTree_['children'][$arrPathTree_['selected_child']])); //echo "
";print_r($arrResult); echo "
"; } return $arrResult; } /** * Print all javascripts in path of the selected menu * @param array $arrMenuTree * @param boolean $_first */ function getJavascriptsInPath($arrMenuTree, $_first=true) { if($_first) $strContent .= ""; //echo "\ngetJavascriptsInPath {$arrMenuTree[id]} "; if (!is_array($arrMenuTree)) return ""; //echo "\ngetJavascriptsInPath-begin"; if ($arrMenuTree['script']) { $strContent .= "\n\n"; $strContent .= $arrMenuTree['script']; $strContent .= "\n\n"; } if ($arrMenuTree['selected']==1 && $arrMenuTree['children'] && is_array($arrMenuTree['children'])) { //echo "level deeper"; $arrChild = $arrMenuTree['children'][$arrMenuTree['selected_child']]; $strContent .= getJavascriptsInPath($arrChild,false); // go one level deeper } return $strContent; } function mmysql_real_escape_string_string($str) { return $str; } ?>
Fatal error: Uncaught Error: Call to undefined function template_get_html() in /var/www/vhosts/advocatenkantoor.nl/httpdocs/library/sitedesq/www/website.inc.php:55 Stack trace: #0 /var/www/vhosts/advocatenkantoor.nl/httpdocs/www/index.php(36): include() #1 {main} thrown in /var/www/vhosts/advocatenkantoor.nl/httpdocs/library/sitedesq/www/website.inc.php on line 55